<template>
  <section>
    <article-editor
      class="report_dialog"
      @close="onEditorArticleClose"
      :z-index="900"
      :article-id="curArticleId"
      :column-id="curColumnId"
      :institutionId="curinstitutionId"
    ></article-editor>
  </section>
</template>

<script>
import ArticleEditor from "../../index/article/ArticleEditor";
import _ from "lodash";
export default {
  name: "articleEditorBlank",
  data() {
    return {
      curArticleId: 0,
      curColumnId: 0,
      institutionId:0,
    };
  },
  created() {
    let articleID = this.$route.query.articleID;
    let columnId = this.$route.query.columnId;
    this.curinstitutionId = Number(this.$route.query.institutionId);

    if (columnId > 0) {
      this.curColumnId = columnId;
    }

    if (articleID > 0 || columnId > 0) {
      this.curArticleId = articleID;
      console.log('articleID:',this.curArticleId);
    } else {
      console.log("我擦");
      window.location.href = "/";
    }
  },
  mounted() {
    this.checkLoginOut();
  },
  computed: {},
  methods: {
    checkLoginOut() {
      let code = setInterval(() => {
        let clearInfo = window.localStorage.getItem("clearInfo");
        console.log(clearInfo);
        if (clearInfo === "clear") {
          window.localStorage.setItem("clearInfo", null);
          clearInterval(code);
          this.closeWindow();
        }
      }, 1000);
    },
    onEditorArticleClose() {
      this.closeWindow();
    },
    // 关闭
    closeWindow() {
      window.localStorage.setItem("refresh", "666");
      window.close();
    }
  },
  components: {
    ArticleEditor
  }
};
</script>

<style scoped lang="less">
@import "../../../styles/flex-layout.less";
.report_dialog {
  /deep/ .el-tree-node {
    margin: 10px 0px;
  }
  /deep/ .el-dialog__header {
    display: none;
  }
  /deep/ .el-dialog__body {
    padding: 0px;
  }
  z-index: 2501 !important;
}
</style>
